package es.castorm.business.customer.internal;

import javax.persistence.Column;
import javax.persistence.Entity;

import es.castorm.arch.data.AbstractEntity;

@Entity
public class Customer extends AbstractEntity {

	@Column(nullable = false)
	private String firstname;

	@Column(nullable = false)
	private String lastname;

	@Column(nullable = false, unique = true)
	private String email;

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Override
	public String toString() {
		return String.format("Customer [id=%d, version=%d, firstname=%s, lastname=%s, email=%s]", getId(), getVersion(), firstname, lastname, email);
	}
}
